setwd("/home1/30/jc227089/SRE_inv/ran_outs")

source("/home1/30/jc227089/evo-dispersal/SRE_inv/SRE_inv_functions.R")

### initialise ###
args=(commandArgs(TRUE))

#evaluate the arguments
# input arguments will be number of replicates runs (rr), file.ID, spread time (sp)
for(i in 1:length(args)) {
	 eval(parse(text=args[[i]]))
}


sim.result<-c()
for (rep in 1:rr){
	out<-mother(steps=10, lambda=5, d.cost=0.9, plot=F, spread=sp, gens.breach=3000)
	sim.result<-rbind(sim.result, out)	
}
sim.result<-cbind(rep(sp, rr), sim.result)
save(sim.result, file=paste("SRE_inv", file.ID, ".RData", sep=""))
